package com.android.delivery.entity.request;

import android.os.Parcel;
import android.os.Parcelable;

import com.android.delivery.entity.Addr;

public class OrderReq implements Parcelable {
    public String logisticsNo;
    public String goodsInfo;
    public double excessWeightFee;
    public int payType;
    public Addr receiverAddress;
    public Addr senderAddress;
    public double baseFee;
    public double excessDistancePickFee;
    public double excessDistanceDeliveryFee;
    public double totalFee;
    public String userMemo;

    public OrderReq() {
    }

    protected OrderReq(Parcel in) {
        logisticsNo = in.readString();
        goodsInfo = in.readString();
        excessWeightFee = in.readDouble();
        payType = in.readInt();
        receiverAddress = in.readParcelable(Addr.class.getClassLoader());
        senderAddress = in.readParcelable(Addr.class.getClassLoader());
        baseFee = in.readDouble();
        excessDistancePickFee = in.readDouble();
        excessDistanceDeliveryFee = in.readDouble();
        totalFee = in.readDouble();
        userMemo = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(logisticsNo);
        dest.writeString(goodsInfo);
        dest.writeDouble(excessWeightFee);
        dest.writeInt(payType);
        dest.writeParcelable(receiverAddress, flags);
        dest.writeParcelable(senderAddress, flags);
        dest.writeDouble(baseFee);
        dest.writeDouble(excessDistancePickFee);
        dest.writeDouble(excessDistanceDeliveryFee);
        dest.writeDouble(totalFee);
        dest.writeString(userMemo);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<OrderReq> CREATOR = new Creator<OrderReq>() {
        @Override
        public OrderReq createFromParcel(Parcel in) {
            return new OrderReq(in);
        }

        @Override
        public OrderReq[] newArray(int size) {
            return new OrderReq[size];
        }
    };
}
